package cn.dxs.gitee.ui.activity;

import android.content.Intent;
import android.net.Uri;

import cn.dxs.gitee.mvp.contract.ISplashContract;
import cn.dxs.gitee.mvp.presenter.SplashPresenter;
import cn.dxs.gitee.ui.activity.base.BaseActivity;

/**
 * 欢迎界面
 *
 * @author lijian
 * @date 2019-09-21 8:37
 */
public class SplashActivity extends BaseActivity<SplashPresenter> implements ISplashContract.View {

    private static final String TAG = "SplashActivity";

    @Override
    protected int getContentView() {
        return 0;
    }

    @Override
    public void showMainPage() {
        delayFinish();
        Uri dataUri = getIntent().getData();
        if (dataUri == null) {
            startActivity(new Intent(getActivity(), MainActivity.class));
        } else {
            // TODO 待处理

        }
    }

    @Override
    public void showLoginPage() {
        delayFinish();
        startActivity(new Intent(getActivity(), LoginActivity.class));
    }

    @Override
    protected void initActivity() {
        super.initActivity();
        mPresenter.getUser();
    }
}
